import numpy as np
from matplotlib import pyplot as plt

x = np.linspace(-np.pi, np.pi, 100)
y1 = np.sin(x)
y2 = np.cos(x)


plt.plot(x, y1, 'g', label='y = sin(x)')
plt.plot(x, y2, 'b', label='y = cos(x)')
plt.legend()
plt.grid()